<template>
	<!-- template-2.0.0 --><!-- 修改密码 -->
	<el-form class="qdp-edit-form" :model="editForm" :rules="editFormRules" label-width="100px" inline ref="editForm" @keydown.13.native.stop="onPost('editForm', 'submit')">
					<el-form-item label="原密码" prop="loginPasswdOld">
						<el-input v-model="editForm.loginPasswdOld" placeholder="" size="small" type="password"></el-input>
					</el-form-item>
					<el-form-item label="新密码" prop="loginPasswd">
						<el-input v-model="editForm.loginPasswd" placeholder="" size="small" type="password"></el-input>
					</el-form-item>
					<el-form-item label="重复新密码" prop="loginPasswdNew">
						<el-input v-model="editForm.loginPasswdNew" placeholder="" size="small" type="password"></el-input>
					</el-form-item>
	</el-form>
	<!-- 修改密码-END -->
</template>
<script type="text/javascript">
	define([ 'vue' ], function(Vue) {
		return {
			template : template, //
			components : {
			},
			//设置选择
			props:{
				editForm:{required:true, type:Object},
				editFormRules:{required:true, type:Object},
				enums:{required:true, type:Object}
			},
			data : function() {
				return {
				};
			}, //
			created : function() {
			}, //
			mounted : function() {
				//快捷键
			},//
			beforeDestroy : function() {
				//快捷键
			},//
			methods : {
				cache : getters.cache,//
				accountId : getters.accountId, //
				resetFields: function(){
					this.$refs.editForm.resetFields();
				},
				validate: function(validFunc){
					this.$refs.editForm.validate(validFunc);
				},
				getOption : function(data, field) {
					var fieldName = field.property || field, enums = ((this.enums || {}).editPassword||{})[fieldName] || {};
					var value = data[fieldName];
					var option = enums[value == null ? '' : value];
					return option == null ? (value == null ? '' : value) : option;
				},
				//
				getSelectionLabel : function(formName, field, labelField) {
					var form = this[formName], names = [], ids = [], datas = form[field + 'Selections'];
					qdpMap(datas, function(value) {
						names.push(value[labelField]);
						ids.push(value.id);
					});
					form[field + 'Name'] = names.join(',');
					form[field] = ids.join(',');
					return;
				},
				resetSelectionLabel : function(formName, field) {
					var ref = this.$refs[formName + '-' + field], ref2 = this.$refs[formName + '-' + field + 'Name'];
					ref && ref.resetField();
					ref2 && ref2.resetField();
					this[formName][field + 'Selections'] = [];
				},
				// 热键，默认就是Ctrl+其他键
				onHotKey : function(event) {
				},//
				onPost : function(eventType, arg0, arg1, arg2, arg3) {
					LOG("EV: onPost." + eventType);
					var root = this;
				}
			}
		};
	});
</script>

